import { defineStore } from 'pinia'

export const useNewsStore = defineStore('news', {
  state: () => ({
    currentNews: null,
    tempRouteData: null // 用于临时存储路由传递的数据
  }),
  actions: {
    setCurrentNews(user) {
      this.currentNews = user
    },
    setTempRouteData(data) {
      this.tempRouteData = data
    },
    clearTempData() {
      this.tempRouteData = null
    }
  }
})